﻿using System.Collections.Generic;
using System;
using Payroll.Common;
namespace Payroll.BusinessLogic.EmployeeManagement
{
    public partial interface IEmployeeService
    {
        #region Employee

        /// <summary>
        /// Sets a employee email
        /// </summary>
        /// <param name="employeeId">Employee identifier</param>
        /// <param name="newEmail">New email</param>
        /// <returns>Employee</returns>
        Employee SetEmail(int employeeId, string newEmail);

        /// <summary>
        /// Sets a employee username
        /// </summary>
        /// <param name="employeeId">Employee identifier</param>
        /// <param name="newUsername">New Username</param>
        /// <returns>Customer</returns>
        Employee ChangeEmployeeUsername(int employeeId, string newUsername);

        EmployeeSession GetEmployeeByGuid(Guid employeeSessionGuid);

        /// <summary>
        /// Create anonymous user for current user
        /// </summary>
        /// <returns>Guest user</returns>
        void CreateAnonymousUser();

        

        /// <summary>
        /// Applies a gift card coupon code to a current customer
        /// </summary>
        /// <param name="couponCodesXml">Coupon code (XML)</param>
        void ApplyGiftCardCouponCode(string couponCodesXml);

        Employee GetEmployeeById(int EmployeeId);

        /// <summary>
        /// Gets all customers
        /// </summary>
        /// <returns>Customer collection</returns>
        PagedList<Employee> GetAllEmployee();        

        /// <summary>
        /// Gets all employee.
        /// </summary>
        /// <param name="registrationFrom">The registration from.</param>
        /// <param name="registrationTo">The registration to.</param>
        /// <param name="email">The email.</param>
        /// <param name="username">The username.</param>
        /// <param name="pageSize">Size of the page.</param>
        /// <param name="pageIndex">Index of the page.</param>
        /// <returns></returns>
        PagedList<Employee> GetAllEmployee(string Name, string username,
            int pageSize, int pageIndex);

        PagedList<Employee> GetAllEmployeeByFilter(int? employeeId, string employeeName = null, string StoreId = null, string PositionId = null,
            string Startingdate = null, string SignedDate = null, string ResignDate = null, bool isDelete = false,
            int pageSize = int.MaxValue, int pageIndex = 0);
        /// <summary>
        /// Gets the employee by employee role id.
        /// </summary>
        /// <param name="Position">The position.</param>
        /// <param name="employeeCode">The employee code.</param>
        /// <param name="employeeName">Name of the employee.</param>
        /// <param name="UserId">The user id.</param>
        /// <returns>Employee collection</returns>
        List<Employee> GetEmployeeByEmployeeRoleId(int storeId, int PositionId, string employeeCode, string employeeName, int UserId, int pageSize = int.MaxValue, int pageIndex = 0);

        /// <summary>
        /// Gets a employee by email
        /// </summary>
        /// <param name="email">Employee Email</param>
        /// <returns>A employee</returns>
        Employee GetEmployeeByEmail(string email);

        /// <summary>
        /// Gets a employee by username
        /// </summary>
        /// <param name="username">Employee username</param>
        /// <returns>A employee</returns>
        Employee GetEmployeeByUsername(string username);

        void SaveEmployee(Employee employee);

        /// <summary>
        /// Updates the employee
        /// </summary>
        /// <param name="customer">Employee</param>
        void UpdateEmployee(Employee employee);
        void SaveEployeeStore(int employeeId, int StoreId, string Effectivedate);
        void SavePosition(int employeeId, int PositionId, string Effectivedate);
        void SaveSalary(int employeeId, int salaryTypeId, string Effectivedate, decimal salary);
        /// <summary>
        /// Modifies password
        /// </summary>
        /// <param name="email">Customer email</param>
        /// <param name="oldPassword">Old password</param>
        /// <param name="password">Password</param>
        void ModifyPassword(string email, string oldPassword, string password);

        /// <summary>
        /// Modifies password
        /// </summary>
        /// <param name="email">Employee email</param>
        /// <param name="newPassword">New password</param>
        void ModifyPassword(string email, string newPassword);

        /// <summary>
        /// Modifies password
        /// </summary>
        /// <param name="customerId">Employee identifier</param>
        /// <param name="newPassword">New password</param>
        void ModifyPassword(int employeeId, string newPassword);

        /// <summary>
        /// Activates a employee
        /// </summary>
        /// <param name="customerId">Employee identifier</param>
        void Activate(int employeerId);

        /// <summary>
        /// Activates a employee
        /// </summary>
        /// <param name="customerId">Custoemployeemer identifier</param>
        /// <param name="sendCustomerWelcomeMessage">A value indivating whether to send employee welcome message</param>
        void Activate(int employeeId, bool sendemployeeWelcomeMessage);

        /// <summary>
        /// Deactivates a employee
        /// </summary>
        /// <param name="customerId">employee identifier</param>
        void Deactivate(int employeeId);

        /// <summary>
        /// Login a employee
        /// </summary>
        /// <param name="email">A employee Username</param>
        /// <param name="password">Password</param>
        /// <returns>Result</returns>
        bool Login(string Username, string password);

        /// <summary>
        /// Logout employee
        /// </summary>
        void Logout();

        #endregion
        #region Employee sessions

        /// <summary>
        /// Gets the employee session by GUID.
        /// </summary>
        /// <param name="customerSessionGuid">The customer session GUID.</param>
        /// <returns></returns>
        EmployeeSession GetEmployeeSessionByGuid(Guid employeeSessionGuid);

        /// <summary>
        /// Gets the employee session by customer id.
        /// </summary>
        /// <param name="employeeId">The employee id.</param>
        /// <returns></returns>
        EmployeeSession GetEmployeeSessionByEmployeeId(int employeeId);
        /// <summary>
        /// Updates the delete.
        /// </summary>
        /// <param name="employeeId">The employee id.</param>
        /// <param name="status">if set to <c>true</c> [status].</param>
        void UpdateDelete(int employeeId, bool status);
        /// <summary>
        /// Deletes the employee session.
        /// </summary>
        /// <param name="employeeSessionGuid">The employee session GUID.</param>
        void DeleteEmployeeSession(Guid employeeSessionGuid);

        /// <summary>
        /// Gets all employee session.
        /// </summary>
        /// <returns>Employee session collection</returns>
        List<EmployeeSession> GetAllEmployeeSession();

        /// <summary>
        /// Deletes the expired employee session.
        /// </summary>
        /// <param name="olderThan">The older than.</param>
        void DeleteExpiredEmployeeSession(DateTime olderThan);
        /// <summary>
        /// Saves the customer session.
        /// </summary>
        /// <param name="employeeSessionGuid">The employee session GUID.</param>
        /// <param name="employeeId">The employee id.</param>
        /// <param name="lastAccessed">The last accessed.</param>
        /// <param name="isExpired">if set to <c>true</c> [is expired].</param>
        /// <returns></returns>
        EmployeeSession SaveCustomerSession(Guid employeeSessionGuid,
            int employeeId, DateTime lastAccessed, bool isExpired);
       
        #endregion
        #region Tranfer
        //PagedList<> GetAllEmployee();
        #endregion
    }
}
